package it.univaq.mwt.common.business;

import it.univaq.mwt.business.NewsService;

public abstract class NewsServiceFactory {

	private static NewsServiceFactory instance;
	
	public abstract NewsService getNewsService();
	

	protected NewsServiceFactory() {
	}
	
	public synchronized static NewsServiceFactory getInstance() {
		if (instance==null) {
			throw new RuntimeException();
		}
		return instance;
	}
	

	public synchronized static void setInstance(NewsServiceFactory factory) {
		if (instance!=null) {
			throw new RuntimeException();
		}
		instance = factory;
		
	}


}
